/*
 * Copyright (c) 2016. For Intelligent Group.
 */

package com.intelligent.ispc.core.repository;


import com.intelligent.ispc.core.entity.FileData;
import com.intelligent.ispc.core.repository.mybatis.MyBatisRepository;

import java.util.List;
import java.util.Map;


/**
 * Created by Julia.Zhou on 2016/07/14.
 */

@MyBatisRepository
public interface FileDataDao {

    /**
     * Create file data.
     *
     * @param fileData details
     */
    void createFileData(FileData fileData);

    /**
     * Update file data.
     *
     * @param fileData details
     */
    void updateFileData(FileData fileData);

    /**
     * Delete file data by id and name.
     *
     * @param id   file id.
     * @param name file name.
     */
    void deleteFileData(Long id, String name);

    /**
     * Delete file data by id .
     *
     * @param id file id.
     */
    void deleteFileDataById(Long id);

    /**
     * Delete file data by name and type.
     * type : GRR / SPC
     *
     * @param type file type.
     * @param name file name.
     */
    void deleteFileDataByName(String name, String type);

    /**
     * Delete file data by more condition params.
     *
     * @param params more condition params.
     */
    void deleteFileDataByNames(Map<String, Object> params);

    /**
     * Delete all file data by type.
     *
     * @param type file type.
     */
    void deleteAllFileDatas(String type);

    /**
     * Find file data by id.
     *
     * @param id file id.
     * @return FileData
     */
    FileData findById(Long id);

    /**
     * Find file data by name and type.
     *
     * @param name file name.
     * @param type file type.
     * @return FileData
     */
    FileData findByNameAndType(String name, String type);

    /**
     * Find files data by type.
     *
     * @param type file type.
     * @return FileData list
     */
    List<FileData> findFileData(String type);

}
